package  tasktest
{
	import flash.utils.setTimeout;
	import iscript.gameFramework.GameLite.events.GameContentEvent;
	import iscript.gameFramework.GameLite.Game;
	import iscript.gameFramework.GameLite.thread.task.TaskAction;

	public class TaskA extends TaskAction
	{
		
		private var _tid:int;
		private var _swf:String = "http://app26483.imgcache.qzoneapp.com/app26483/raymond/user_run.swf";
		public function TaskA(tid:int) 
		{
			_tid = tid;
		}
		
		override public function execute():void 
		{
			super.execute();
			/*trace("A:", _id)
			setTimeout(function():void { finish() }, 
			 1000
			);*/
			
			if (Game.Content.containGameContent(_swf)) {
				loadSWF(null)
				}else {
				Game.Content.addGameContentListener(_swf,loadSWF)
				Game.Content.addSwf(_swf);
			}
			
			trace(Game.Content.count,">>>>>>>>>>>>>>>>>>>>");
			
		}
		
		private function loadSWF(e:GameContentEvent):void 
		{
		 	Game.Content.removeGameContentListener(_swf,loadSWF)
			trace("A:", _tid)
			finish();
		}
		
		
		
	}

}